import type { Component, Ref } from 'vue'
import type { RouteMeta } from 'vue-router'
import type { voidfn } from './common'
import type { RouterHistory } from './history'

export interface RouteRecordRaw {
  path: string
  name?: string
  children?: RouteRecordRaw[]
  component: Component
  meta?: RouteMeta
  beforeEnter?: voidfn
}

export interface RouterOptions {
  history: RouterHistory
  routes: Readonly<RouteRecordRaw[]>
}

export interface Router {
  push(to: string | Ref<string>): voidfn
  install(): void
  beforeEach(guard: voidfn): voidfn
  beforeResolve(guard: voidfn): voidfn
  afterEach(guard: voidfn): voidfn
}

